#include<bits/stdc++.h>
using namespace std;
int day[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};
int cnt=0,a,b,i,j,sum=0;
int main()
{
	cin>>a>>b;
	for(i=1;i<=12;i++)
	{
		for(j=1;j<=day[i];j++)
		{
			sum=j%10*1000+j/10*100+i/10+i%10*10;
			sum=sum*10000+j+i*100;
			if(a<=sum&&sum<=b)
//			if(sum<a||sum>b)
//				continue;
			cnt++;
		}	
	}
	cout<<cnt;
    return 0;
}
